package com.hua.nailcampus.acl.model.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.hua.nailcampus.acl.model.Messages;
import lombok.Data;
import org.joda.time.DateTime;

import java.io.Serializable;

/**
 * @Author:chenjianhua
 * @Date:2023/11/30 12:54
 * @Version 1.8
 */
@Data
public class MessagesVo implements Serializable {

    private static final long serialVersionUID = 1L;

    private Integer id;

    private Integer toUserId;

    private Integer fromUserId;

    private String userName;
    private String toUserName;
    private String avaUrl;

    private String content;

    private String sendTime;

    private Integer badgeNumber;

    public MessagesVo(){
    }
    public MessagesVo(Messages messages){
        this.id = messages.getId();
        this.fromUserId = messages.getFromUserID();
        this.toUserId = messages.getToUserID();
        this.content = messages.getContent();
        this.sendTime = new DateTime(messages.getCreateTime()).toString("yyyy-MM-dd HH:mm:ss");
    }
}
